package com.party.mobile.web.dto.photo.output;

import com.google.common.collect.Lists;
import com.party.core.model.photo.PhotosImgInfo;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;
import java.util.List;

/**
 * @Description: ${todo}
 * @Author: yangshoukun
 * @Date: 2018/6/5 10:16
 */
public class ImgOutput implements Serializable {

    private static final long serialVersionUID = 8672749061561140058L;
    // 相册id
    private String photosId;
    // 图片路径
    private String url;
    // 图片id
    private String id;
    // 是否有分类
    private Integer hasTag;
    // 最后更新时间
    private String lastTime;
    // 最后更新人
    private String lastMember;
    // 最后更新人对所有照片的操作次数
    private Integer memberOperateNum;
    // 浏览量
    private Integer viewNum;
    // 操作次数
    private Integer operateNum;
    // 照片的所有分类
    private List<TagOutput> tags = Lists.newArrayList();


    public Integer getHasTag() {
        return hasTag;
    }

    public void setHasTag(Integer hasTag) {
        this.hasTag = hasTag;
    }

    public String getPhotosId() {
        return photosId;
    }

    public void setPhotosId(String photosId) {
        this.photosId = photosId;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getLastTime() {
        return lastTime;
    }

    public void setLastTime(String lastTime) {
        this.lastTime = lastTime;
    }

    public String getLastMember() {
        return lastMember;
    }

    public void setLastMember(String lastMember) {
        this.lastMember = lastMember;
    }

    public Integer getMemberOperateNum() {
        return memberOperateNum;
    }

    public void setMemberOperateNum(Integer memberOperateNum) {
        this.memberOperateNum = memberOperateNum;
    }

    public List<TagOutput> getTags() {
        return tags;
    }

    public void setTags(List<TagOutput> tags) {
        this.tags = tags;
    }

    public Integer getViewNum() {
        return viewNum;
    }

    public void setViewNum(Integer viewNum) {
        this.viewNum = viewNum;
    }

    public Integer getOperateNum() {
        return operateNum;
    }

    public void setOperateNum(Integer operateNum) {
        this.operateNum = operateNum;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof ImgOutput)) return false;

        ImgOutput output = (ImgOutput) o;

        if (photosId != null ? !photosId.equals(output.photosId) : output.photosId != null) return false;
        if (url != null ? !url.equals(output.url) : output.url != null) return false;
        if (id != null ? !id.equals(output.id) : output.id != null) return false;
        return hasTag != null ? hasTag.equals(output.hasTag) : output.hasTag == null;
    }

    @Override
    public int hashCode() {
        int result = photosId != null ? photosId.hashCode() : 0;
        result = 31 * result + (url != null ? url.hashCode() : 0);
        result = 31 * result + (id != null ? id.hashCode() : 0);
        result = 31 * result + (hasTag != null ? hasTag.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "ImgOutput{" +
                "photosId='" + photosId + '\'' +
                ", url='" + url + '\'' +
                ", id='" + id + '\'' +
                ", hasTag=" + hasTag +
                '}';
    }

    public static ImgOutput transform(PhotosImgInfo photosImgInfo) {
        ImgOutput output = new ImgOutput();
        BeanUtils.copyProperties(photosImgInfo, output);
        return output;
    }
}
